home *** CD-ROM | disk | FTP | other *** search
/ Linear Technology Linearview 1996 / linearview 1996.iso / spice / demoltc.bat < prev    next >
Encoding:
DOS Batch File  |  1996-07-09  |  8.6 KB  |  226 lines

  1. echo off
  2. cls
  3. rem ------------------------------------------------------------------
  4. rem
  5. rem                          DEMOLTC.BAT
  6. rem                version for macromodel release 2.0
  7. rem                       Walt Jung 05/04/90
  8. rem
  9. rem This batch file will run a DEMO version of PSPICE, and do a test
  10. rem simulation with a specified ".CIR" file, supplied on this diskette.
  11. rem
  12. rem Usage is  "DEMOLTC" (or "DEMOLTC 1007"), to run a default LT1007 demo.
  13. rem or, alternately, the forms below:
  14. rem
  15. rem Summary of usage:
  16. rem"DEMOLTC"       (to run the default LT1007 example),
  17. rem"DEMOLTC RIAA"  (to run the RIAA demo),
  18. rem"DEMOLTC 1078"  (to run the LT1078 data sheet demo),
  19. rem"DEMO EXAMPLE1" (to run the PSpice example1)
  20. rem
  21. rem ------------------------------------------------------------------
  22. rem look at command line tail and evaluate
  23. rem ------------------------------------------------------------------
  24. if (%1)==() goto demo           : default to LT1007, if nothing spec'd
  25. if (%1)==(1007) goto demo       : default also, if asked for 1007
  26. if (%1)==(1078) goto demo       : if asked for 1078
  27. if (%1)==(1056) goto demo       : if asked for 1056
  28. if (%1)==(RIAA) goto demo       : RIAA demo
  29. if (%1)==(riaa) goto demo       : ditto
  30. if (%1)==(example1) goto demo   : PSpice demo
  31. if (%1)==(EXAMPLE1) goto demo   : ditto
  32. :telerr
  33. rem ------------------------------------------------------------------
  34. rem if this far, all not well. abort with msg above, and note bad cmd
  35. rem ------------------------------------------------------------------
  36. cls
  37. echo  
  38. echo  
  39. echo  
  40. echo Sorry, but we need a correct NAME to complete the DEMO run.
  41. echo  
  42. echo Available are: "RIAA", "EXAMPLE1", etc., as shown below.
  43. echo  
  44. echo  
  45. echo Re-enter command as "DEMOLTC" (default), or one of the following options:
  46. echo  
  47. echo "DEMOLTC RIAA"     or, alternately, just
  48. echo "DEMOLTC"          (either will run the default LT1007 example),
  49. echo  
  50. echo "DEMOLTC RIAA"     (will run an LT1115 data sheet RIAA preamp demo),
  51. echo "DEMOLTC 1078"     (will run an LT1078 data sheet full-wave rect. demo),
  52. echo "DEMOLTC 1056"     (will run an LT1056 data sheet asymmetric SR demo),
  53. echo "DEMO EXAMPLE1"    (will run the PSpice Example1 demo)
  54. echo  
  55. echo  
  56. goto badxt
  57. :demo
  58. rem ------------------------------------------------------------------
  59. rem make sure in root DIR, then log into SPICE DIR
  60. rem ------------------------------------------------------------------
  61. :spicedir
  62. rem was: "cd \SPICE" 12/03/90
  63. cd SPICE
  64. :scrubfiles     
  65. rem ------------------------------------------------------------------
  66. rem clean up old stuff not needed, need LOTS of room!
  67. rem ------------------------------------------------------------------
  68. if exist *.dat del *.dat
  69. if exist *.out del *.out
  70. if exist *.log del *.log
  71. if exist *.tmp del *.tmp
  72. :tstfiles
  73. cls
  74. rem ------------------------------------------------------------------
  75. rem test for existence of necessary files on disc, if no, warn & exit
  76. rem ------------------------------------------------------------------
  77. if exist pspice1.exe goto psexeok1      : pspice1 here?
  78. goto nofiles                            : nope abort
  79. :psexeok1                               
  80. if exist probe.exe goto prbok           : how about probe?
  81. goto nofiles                            : abort
  82. :prbok
  83. if not exist demo1007.cir goto nofiles  : check here for ALL CIR files
  84. :demook                                 : first look for default,
  85. :demoexam2                              : then finally PSpice example1
  86. if not exist example1.cir goto nofiles
  87. goto fileok                             : if any above missing, abort
  88. :nofiles
  89. rem ------------------------------------------------------------------
  90. rem beep (once) for some missing or no files and warn
  91. rem ------------------------------------------------------------------
  92. cls
  93. echo   
  94. echo  
  95. echo  
  96. echo DEMO PSpice and Probe files not found!  Copy to SPICE subdir,
  97. echo then rerun this DEMOLTC batch file.
  98. echo  
  99. echo  
  100. cd..
  101. goto badxt                              : bypass all and exit
  102. :fileok
  103. rem ------------------------------------------------------------------
  104. rem Ok, we can NOW run the demo!
  105. rem ------------------------------------------------------------------
  106. cls
  107. echo  
  108. echo Now loading PSPICE for DEMO run, please wait...
  109. echo  
  110. if (%1)==() goto demodef        : default if nothing else requested
  111. if (%1)==(1007) goto demodef    : default if asked 'demo1007'
  112. :demowild                       : test for example1, otherwise fall into DEMO%1
  113. if (%1)==(example1) goto example1
  114. if (%1)==(EXAMPLE1) goto example1
  115. : if not default, not ex1, must be wildcard, any %1 4char (or less)
  116. PSPICE1 DEMO%1
  117. IF ERRORLEVEL 1 GOTO EXIT
  118. IF EXIST PROBE.DAT  GOTO PROBE
  119. :example1                       : come here, if DEMOLTC EXAMPLE1 (special case)
  120. PSPICE1 example1 %2
  121. IF ERRORLEVEL 1 GOTO EXIT
  122. IF EXIST PROBE.DAT  GOTO PROBE
  123. :demodef                        : come here for default demo
  124. PSPICE1 DEMO1007 %2
  125. IF ERRORLEVEL 1 GOTO EXIT
  126. IF EXIST PROBE.DAT  GOTO PROBE
  127. :abort
  128. rem ------------------------------------------------------------------
  129. rem it is assumed we are calling for probe, if NO PROBE.DAT,
  130. rem this means error(s),  fall into abort
  131. rem ------------------------------------------------------------------
  132. cls
  133. echo Error(s) encountered, no "PROBE.DAT" file created.
  134. echo Check files on diskette for integrity.
  135. echo                                               
  136. echo           
  137. goto badxt
  138. :probe
  139. rem ------------------------------------------------------------------
  140. rem NOW(!) run probe (after some more testing)
  141. rem ------------------------------------------------------------------
  142. :p1
  143. if exist DEMO%1.CMD goto p3
  144. if exist demo1007.cmd goto p3
  145. if exist example1.cmd goto p3
  146. if exist demo1078.cmd goto p3
  147. :p2
  148. rem ------------------------------------------------------------------
  149. rem if any CDM file, jump around below,
  150. rem otherwise fall into plain vanilla probe
  151. rem ------------------------------------------------------------------
  152. cls
  153. echo Now calling PSpice PROBE for output display.  When the
  154. echo PROBE menu appears, enter commands (less quotes) as follows:
  155. echo                                               
  156. echo  
  157. echo A) Enter a "1"  or "Enter" (to 'Add trace')
  158. echo  
  159. echo B) Enter "V(55)", then "Enter" (to display the PSpice output)
  160. echo  
  161. echo C) Enter an "8", then "Enter" (to optionally printout the trace)
  162. echo (but only if you have verified "PROBE.DEV" matches your printer!)
  163. echo  
  164. echo  
  165. echo This PROBE display uses "TEXT" for the display mode. If you have
  166. echo a graphic display such as Ega, Cga, Hercules, the README file in
  167. echo the SPICE directory tells you how to set up probe for nice graphics.
  168. echo  
  169. echo (DO write the above down if PROBE is not familiar, then...)
  170. pause
  171. cls
  172. echo  
  173. echo Now loading PROBE for DEMO display, please wait...
  174. echo  
  175. pause
  176. probe probe.dat
  177. rem ------------------------------------------------------------------
  178. rem now finished with probe, start exit
  179. rem ------------------------------------------------------------------
  180. goto p4
  181. :p3
  182. rem ------------------------------------------------------------------
  183. rem come here when any CDM file, run probe with canned cmds
  184. rem ------------------------------------------------------------------
  185. cls
  186. echo  
  187. echo Now loading PROBE for DEMO display, please wait...
  188. echo  
  189. if (%1)==(RIAA) goto p31
  190. if (%1)==(riaa) goto p31
  191. :addmore options here if (%1)==(RIAA) goto p31
  192. :addmore options here if (%1)==(riaa) goto p31
  193. if (%1)==() goto p32
  194. if (%1)==(1007) goto p32
  195. if (%1)==(EXAMPLE1) goto p33
  196. if (%1)==(example1) goto p33
  197. rem
  198. if exist DEMO%1.CMD goto p31
  199. if exist demo1007.cmd goto p32
  200. :p31                    : run this if DEMOLTC xxxx on dos cmd line
  201. if not exist DEMO%1.cmd goto p2
  202. probe probe.dat /cDEMO%1.CMD /lDEMO%1.LOG
  203. goto p4
  204. :p32                    : run this if DEMOLTC or DEMOLTC 1007 on dos cmd line
  205. if not exist DEMO1007.cmd goto p2
  206. probe probe.dat /cDEMO1007.CMD /lDEMO1007.LOG
  207. goto p4
  208. :p33                    : run this if DEMO EXAMPLE1 on dos cmd line
  209. if not exist example1.cmd goto p2
  210. probe probe.dat /cexample1.CMD /lexample1.LOG
  211. :p4                     : just about done now
  212. cd..
  213. rem now back where we started from
  214. goto exitnorm
  215. :exitnorm               : tell user about files to study
  216. cls
  217. echo  
  218. echo Your PSpice ASCII output file is available in SPICE\*.OUT.
  219. echo  
  220. echo Related SPICE files are ".CIR", ".CMD", and ".LOG".
  221. echo  
  222. echo Note!  Also see the important info contained in README, and SPICE\README2.
  223. echo  
  224. :badxt                  : come here if something went wrong (msgs above)
  225. :exit
  226.